<?php
include "includes/session.php";
include "includes/comunes.php";
$sql="select * from stock_articulo";
$eje=cons_sql_up($sql);

while($reg=mysql_fetch_array($eje)):
    $cant=strlen(trim($reg['Codigo']));
	$codigo="C";
	for($i=0;$i<(8-$cant);$i++){
	$codigo.="0";
	}
	$codigo.=trim($reg['Codigo']);
    $sql1="UPDATE `stock_articulo` SET `Codigo`='".$codigo."' WHERE `id`=".$reg['id'];
    //echo $sql."<br>";
   $ejec=cons_sql_up($sql1);
endwhile;	

?>